<include file="public/layout" />
<script type="text/javascript" src="__ROOT__/public/static/js/layer/laydate/laydate.js"></script>

<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <div class="subject">
        <h3>一元夺宝订单</h3>
        <h5>一元夺宝交易订单查询及管理</h5>
      </div>
    </div>
  </div>
  <!-- 操作说明 -->
  <div id="explanation" class="explanation" style=" width: 99%; height: 100%;">
    <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
      <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
      <span title="收起提示" id="explanationZoom" style="display: block;"></span>
    </div>
     <ul>
      <li>查看操作可以查看订单详情, 包括支付费用, 商品详情等</li>
      <li>未支付的订单可以取消</li>
      <li>用户收货后, 如果没有点击"确认收货",系统自动根据设置的时间跟商家结算.</li>
    </ul>
  </div>
  <div class="flexigrid">
    <div class="mDiv">
      <div class="ftitle">
        <h3>订单列表</h3>
        <h5>(共{$page->totalRows}条记录)</h5>
      </div>
      <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
	  <form class="navbar-form form-inline"  method="post" action="{:U('Admin/order/indiana_order_list')}"  name="search-form2" id="search-form2">  
	  		<input type="hidden" name="order_by" value="order_id">
            <input type="hidden" name="sort" value="desc">
            <input type="hidden" name="user_id" value="{$Request.param.user_id}">
            <!--用于查看结算统计 包含了哪些订单-->
            <input type="hidden" value="{$_GET['order_statis_id']}" name="order_statis_id" />
                                    
      <div class="sDiv">
        <div class="sDiv2">
        	<input type="text" size="30" id="add_time_begin" name="add_time_begin" value="" class="qsbox"  placeholder="下单开始时间">
        </div>
        <div class="sDiv2">
        	<input type="text" size="30" id="add_time_end" name="add_time_end" value="" class="qsbox"  placeholder="下单结束时间">
        </div>
        <div class="sDiv2">	 
        	<select name="pay_status" class="select" style="width:100px;margin-right:5px;margin-left:5px">
                    <option value="">支付状态</option>
                    <option value="0">未支付</option>
        			<option value="1">已支付</option>
            </select>
        </div>
        <div class="sDiv2">	   
            <select name="pay_code" class="select" style="width:100px;margin-right:5px;margin-left:5px">
                <option value="">支付方式</option>
                <option value="alipay">支付宝支付</option>
				<option value="weixin">微信支付</option>
				<option value="cod">货到付款</option>
             </select>
         </div>
         <div class="sDiv2">	 
             <select name="is_praise" class="select" style="width:100px;">
                <option value="">中奖状态</option>
                <option value="0">未中奖</option>
                <option value="1">已中奖</option>
             </select>
          </div>
          <div class="sDiv2">	 
             <select name="order_status" class="select" style="width:100px;">
                  <option value="">订单状态</option>
                  <volist name="order_status" id="v" key="k">
                      <option value="{$k-1}">{$v}</option>
                  </volist>
              </select>       
         </div>
         <div class="sDiv2">	                
          <select  name="keytype" class="select">
            <option value="consignee">参与者</option>
            <option value="order_sn">订单编号</option>
            </foreach>            
          </select>
         </div>
         <div class="sDiv2">	 
          <input type="text" size="30" name="keywords" class="qsbox" placeholder="搜索相关数据...">
        </div>
        <div class="sDiv2">	 
          <input type="submit"  class="btn" value="搜索">
        </div>
      </div>
     </form>
    </div>
    <div class="hDiv">
      <div class="hDivBox" id="ajax_return">
        <table cellspacing="0" cellpadding="0">
          <thead>
	        	<tr>
	              <th class="sign" axis="col0">
	                <div style="width: 24px;"><i class="ico-check"></i></div>
	              </th>
	              <th align="left" abbr="order_sn" axis="col3" class="">
	                <div style="text-align: left; width: 160px;" class="">订单编号</div>
	              </th>
	              <th align="left" abbr="consignee" axis="col4" class="">
	                <div style="text-align: left; width: 80px;" class="">参与者</div>
	              </th>
	              <th align="center" abbr="article_show" axis="col5" class="">
	                <div style="text-align: center; width: 80px;" class="">总金额</div>
	              </th>
	              <th align="center" abbr="article_time" axis="col6" class="">
	                <div style="text-align: center; width: 80px;" class="">订单状态</div>
	              </th>
	              <th align="center" abbr="article_time" axis="col6" class="">
	                <div style="text-align: center; width: 80px;" class="">支付状态</div>
	              </th>
	              <th align="center" abbr="article_time" axis="col6" class="">
	                <div style="text-align: center; width: 80px;" class="">是否中奖</div>
	              </th>
	              <th align="center" abbr="article_time" axis="col6" class="">
	                <div style="text-align: center; width: 80px;" class="">支付方式</div>
	              </th>
	              <th align="center" abbr="article_time" axis="col6" class="">
	                <div style="text-align: center; width: 160px;" class="">下单时间</div>
	              </th>
	              <th align="left" axis="col1" class="handle">
	                <div style="text-align: left; width: 150px;">操作</div>
	              </th>
	              <th style="width:100%" axis="col7">
	                <div></div>
	              </th>
	            </tr>
	          </thead>
        </table>
      </div>
    </div>
    <div class="tDiv">
      <div class="tDiv2">
        <div class="fbutton"> 
        	<a href="javascript:exportReport()">
	          	<div class="add" title="选定行数据导出excel文件,如果不选中行，将导出列表所有数据">
	            	<span><i class="fa fa-plus"></i>导出数据</span>
	          	</div>
          	</a> 
         </div>
      </div>
      <div style="clear:both"></div>
    </div>
    <div class="bDiv" style="height: auto;">
      <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
        <table>
				 	<tbody>
				 	<if condition="empty($orderList) eq true">
				 		<tr data-id="0">
					        <td class="no-data" align="center" axis="col0" colspan="50">
					        	<i class="fa fa-exclamation-circle"></i>没有符合条件的记录
					        </td>
					     </tr>
					<else/>
				 	<volist name="orderList" id="list">
				  	<tr>
				        <td class="sign" axis="col0">
				          <div style="width: 24px;"><i class="ico-check"></i></div>
				        </td>
				        <td align="left" abbr="order_sn" axis="col3" class="">
				          <div style="text-align: left; width: 160px;" class="">{$list.order_sn}</div>
				        </td>
				        <td align="left" abbr="consignee" axis="col4" class="">
				          <div style="text-align: left; width: 80px;" class="">{$list.user.nickname}</div>
				        </td>
				        <td align="center" abbr="article_time" axis="col6" class="">
				          <div style="text-align: center; width: 80px;" class="">￥{$list.order_amount}</div>
				        </td>
				        <td align="center" abbr="article_time" axis="col6" class="">
				          <div style="text-align: center; width: 80px;" class="">{$order_status[$list[order_status]]}<if condition="$list['is_cod'] eq '1'"><span style="color: red">(货到付款)</span></if></div>
				        </td>
				        <td align="center" abbr="article_time" axis="col6" class="">
				          <div style="text-align: center; width: 80px;" class="">{$pay_status[$list[pay_status]]}</div>
				        </td>
				        <td align="center" abbr="article_time" axis="col6" class="">
				          <div style="text-align: center; width: 80px;" class=""><if $list.is_praise == 0>未中奖<else>已中奖</else></if></div>
				        </td>
				        <td align="center" abbr="article_time" axis="col6" class="">
				          <div style="text-align: center; width: 80px;" class="">{$list.pay_name|default='其他方式'}</div>
				        </td>
				        <td align="center" abbr="article_time" axis="col6" class="">
				          <div style="text-align: center; width: 160px;" class="">{$list.addtime|date='Y-m-d H:i',###}</div>
				        </td>
				        <td align="left" axis="col1" class="handle" align="center">
				        		<div style="text-align: left; ">
				        			<a class="btn green" href="{:U('Admin/order/indiana_order_info',array('id'=>$list['id']))}"><i class="fa fa-list-alt"></i>查看</a>
				        			<if condition="($list['order_status'] eq 3) or ($list['order_status'] eq 5)">
				        				<a class="btn red" href="javascript:void(0);" data-href="{:U('Admin/order/delete_order',array('order_id'=>$list['order_id']))}" onclick="del(this)"><i class="fa fa-trash-o"></i>删除</a>
				        			</if>
				        		</div>
				         </td>
				         <td align="" class="" style="width: 100%;">
				            <div>&nbsp;</div>
				          </td>
				      </tr>
				      </volist>
				      </if>
				    </tbody>
				</table>
				<div class="row">
				    <div class="col-sm-6 text-left"></div>
				    <div class="col-sm-6 text-right">{$page}</div>
				</div>
				<script>
				    // 点击分页触发的事件
			          $(".pagination  a").click(function(){
			              cur_page = $(this).data('p');
			              location.href = "/admin/order/indiana_order_list/p/"+cur_page;
			          });
				    
				 // 删除操作
				    function del(obj) {
						if(confirm('确定要删除吗?')){
							location.href = $(obj).attr('data-href');  
						};
					}
				    
				    $('.ftitle>h5').empty().html("(共{$pager->totalRows}条记录)");
				</script>
      </div>
      <div class="iDiv" style="display: none;"></div>
    </div>
    <!--分页位置--> 
   	</div>
</div>
<script type="text/javascript">

	 
    $(document).ready(function(){	
	   
     	$('#add_time_begin').layDate(); 
     	$('#add_time_end').layDate();

	  });

	 
</script>
</body>
</html>